package com.zhongkai.model3;

import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Objects;

@Entity
@Table(name = "maintain",    catalog = "")
public class Maintain implements Serializable {
    private Long id;
    private String tainUuid;
    private String tainName;
    private String tainSex;
    private String tainSection;
    private String tainSectionName;
    private String tainPassword;
    private String tainPhone;
    private String tainStatus;
    private Long tainTime;
    private String tainRemove;
    private String tainMail;
    private String ordUuid;

    private String mainToken;
    private String mainIp;
    private Integer mainState;


    @Basic
    @Column(name = "main_token")
    public String getMainToken() {
        return mainToken;
    }

    public void setMainToken(String mainToken) {
        this.mainToken = mainToken;
    }

    @Basic
    @Column(name = "main_ip")
    public String getMainIp() {
        return mainIp;
    }

    public void setMainIp(String mainIp) {
        this.mainIp = mainIp;
    }

    @Basic
    @Column(name = "main_state")
    public Integer getMainState() {
        return mainState;
    }

    public void setMainState(Integer mainState) {
        this.mainState = mainState;
    }

/*    ALTER TABLE maintain add main_token varchar(30);
    ALTER TABLE maintain add main_ip varchar(30);
    ALTER TABLE maintain add main_state int;*/

    @Basic
    @Column(name = "tain_section_name")
    public String getTainSectionName() {
        return tainSectionName;
    }

    public void setTainSectionName(String tainSectionName) {
        this.tainSectionName = tainSectionName;
    }

    @Id
    @GenericGenerator(name = "generator", strategy = "increment")
    @GeneratedValue(generator = "generator")
    @Column(name = "id")
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "tain_uuid")
    public String getTainUuid() {
        return tainUuid;
    }

    public void setTainUuid(String tainUuid) {
        this.tainUuid = tainUuid;
    }

    @Basic
    @Column(name = "tain_name")
    public String getTainName() {
        return tainName;
    }

    public void setTainName(String tainName) {
        this.tainName = tainName;
    }

    @Basic
    @Column(name = "tain_sex")
    public String getTainSex() {
        return tainSex;
    }

    public void setTainSex(String tainSex) {
        this.tainSex = tainSex;
    }

    @Basic
    @Column(name = "tain_section")
    public String getTainSection() {
        return tainSection;
    }

    public void setTainSection(String tainSection) {
        this.tainSection = tainSection;
    }

    @Basic
    @Column(name = "tain_password")
    public String getTainPassword() {
        return tainPassword;
    }

    public void setTainPassword(String tainPassword) {
        this.tainPassword = tainPassword;
    }

    @Basic
    @Column(name = "tain_phone")
    public String getTainPhone() {
        return tainPhone;
    }

    public void setTainPhone(String tainPhone) {
        this.tainPhone = tainPhone;
    }

    @Basic
    @Column(name = "tain_status")
    public String getTainStatus() {
        return tainStatus;
    }

    public void setTainStatus(String tainStatus) {
        this.tainStatus = tainStatus;
    }

    @Basic
    @Column(name = "tain_time")
    public Long getTainTime() {
        return tainTime;
    }

    public void setTainTime(Long tainTime) {
        this.tainTime = tainTime;
    }

    @Basic
    @Column(name = "tain_remove")
    public String getTainRemove() {
        return tainRemove;
    }

    public void setTainRemove(String tainRemove) {
        this.tainRemove = tainRemove;
    }

    @Basic
    @Column(name = "tain_mail")
    public String getTainMail() {
        return tainMail;
    }

    public void setTainMail(String tainMail) {
        this.tainMail = tainMail;
    }

    @Basic
    @Column(name = "ord_uuid")
    public String getOrdUuid() {
        return ordUuid;
    }

    public void setOrdUuid(String ordUuid) {
        this.ordUuid = ordUuid;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Maintain maintain = (Maintain) o;
        return Objects.equals(id, maintain.id) &&
                Objects.equals(tainUuid, maintain.tainUuid) &&
                Objects.equals(tainName, maintain.tainName) &&
                Objects.equals(tainSex, maintain.tainSex) &&
                Objects.equals(tainSection, maintain.tainSection) &&
                Objects.equals(tainPassword, maintain.tainPassword) &&
                Objects.equals(tainPhone, maintain.tainPhone) &&
                Objects.equals(tainStatus, maintain.tainStatus) &&
                Objects.equals(tainTime, maintain.tainTime) &&
                Objects.equals(tainRemove, maintain.tainRemove) &&
                Objects.equals(tainMail, maintain.tainMail) &&
                Objects.equals(ordUuid, maintain.ordUuid);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, tainUuid, tainName, tainSex, tainSection, tainPassword, tainPhone, tainStatus, tainTime, tainRemove, tainMail, ordUuid);
    }
}
